package com.freesky.web.portal.reomte;

import com.freesky.common.utils.reponse.JSONResponse;
import com.freesky.web.portal.reomte.fallback.SearchRemoteFallback;
import io.swagger.annotations.ApiOperation;
import org.springframework.cloud.netflix.feign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;

@FeignClient(name = "emall-provider-zuul", fallback = SearchRemoteFallback.class)
public interface SearchRemote {
    String ZUUL_URL_PREFIX ="/mysevice/search";
    @GetMapping(value =ZUUL_URL_PREFIX+ "/item/search")
    JSONResponse searchProduct(
            @RequestParam(value = "key",defaultValue = "") String key,
            @RequestParam(value = "page",defaultValue = "1") int page,
            @RequestParam(value = "size",defaultValue = "20") int size,
            @RequestParam(value = "sort",defaultValue = "") String sort,
            @RequestParam(value = "priceGt",defaultValue = "-1") int priceGt,
            @RequestParam(value = "priceLte",defaultValue = "-1") int priceLte) ;
    @GetMapping(value = ZUUL_URL_PREFIX+ "/item/search/item_name_list")
    JSONResponse getItemNameListByKeyWords(@RequestParam(value = "key", defaultValue = "") String key);
}
